
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author 09lmartinelli
 */
public class Main {
    public static void main(String[] args) {
        Connection conn = ConnectionFactory.createConnection();
        
        // Anfrage-Statement erzeugen.
        Statement query;
        try {
            query = conn.createStatement();

            // Ergebnistabelle erzeugen und abholen.
            String sql = "SELECT * FROM tb_user";
            ResultSet result = query.executeQuery(sql);

            // Ergebnissätze durchfahren.
            while (result.next()) {
                String username = result.getString("username");
                System.out.println(username);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
